package com.njwb.ui;

import com.njwb.entity.User;
import com.njwb.service.UserService;
import com.njwb.service.impl.UserServiceImpl;

import java.util.Scanner;

/**
 * Description: 类的描述
 * Author: yuandeyin@itany.com
 * Date: 2025-08-12 13:58
 * Version: 1.0
 */
public class RegistUI {
    public static void main(String[] args) {
        System.out.println("欢迎使用X系统，现在开始注册");
        Scanner input = new Scanner(System.in);
        System.out.print("请输入手机号:");
        String phone = input.next();
        System.out.print("请输入密码:");
        String pwd = input.next();

        UserService userService = new UserServiceImpl();
        try{
            User user = new User();
            user.setPhone(phone);
            user.setPwd(pwd);
            userService.regist(user);
            System.out.println("注册成功，跳转到登录页。。。。");
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
}
